package com.chrray.position.enums.app;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 竞聘状态:1-待录用/2-已录用/3-已完工/
 *       -1-已取消(前端不展示)
 */
public enum FdWorkJobStateEnum implements BaseEnum{
    CANCEL(-1, "已取消"),
    WAIT(1, "待录用"),
    EMPLOYED(2, "已录用"),
    FINISHED(3, "已完工"),
    ;

    @JsonValue
    @EnumValue
    private final Integer value;
    private final String info;

    FdWorkJobStateEnum(Integer value, String info) {
        this.info = info;
        this.value = value;
    }

    @JsonCreator
    public static FdWorkJobStateEnum getByValue(Integer value) {
        for (FdWorkJobStateEnum en : FdWorkJobStateEnum.values()) {
            if (en.getValue().equals(value)) {
                return en;
            }
        }
        return null;
    }

    public Integer getValue() {
        return value;
    }

    public String getInfo() {
        return info;
    }
}
